@extends('layouts._main')

@section('title','电子小票')

@section('css')
    <style>
        body{
            background-color: #ECECEC;
        }
        .weui-loadmore_line .weui-loadmore__tips {
            background-color: #ECECEC;
        }
        .body{
            font-size: 14px;
            padding-top: 30px;
        }
        .desc{
            text-align: center;
        }
        .bar_code{
            text-align: center;
            font-size: 16px;
        }
        .img{
            margin-top: 20px;
            width: 99%;
            height: 80px;
        }
        .english{
            font-size: 2rem;
            margin-top: 30px;
            padding-left: 20px;
        }
        .receipt_body{
            background-color: #fff;
            text-align: left;
            padding: 20px 15px;
            width: 84%;
            margin: 0 auto;
            margin-top: -25px;
        }
        .receipt_title{
            text-align: left;
            font-size: 16px;
            margin-bottom: 20px;
        }
        .weui-flex{
            margin: 10px 0px;
        }
        .dotted{
            border-bottom:dashed 1px #333;
        }
        .dotted-top{
            border-top:dashed 1px #333;
        }
        .nav_bar{
            background-color: #fff;
            padding: 10px 15px;
            text-align: center;
            border-bottom: 1px solid #D0D0D0;
        }
        .nav_bar>.nav_back {
            background: url('/images/version1/icon_bar_back.png') no-repeat;
            background-size: 20px 20px;
            display: inline-block;
            float: left;
        }
    </style>
@endsection

@section('container')

    <div class="nav_bar">
        电子小票
        <div class="nav_back"></div>
    </div>
    <div class="body">

        <h3 class="desc">请凭条码到对应门店服务台进行售后服务</h3>
        <div class="bar_code">
            <div class="img">
                <img src="data:image/png;base64,{{ \DNS1D::getBarcodePNG("9999000020227", "C128",1.8,70) }}" alt="barcode"   />
            </div>
            <p>小票号：{{ $sale_info['reeipt_no'] }}</p>
        </div>

        <div class="english">RECEIPT</div>

        <div class="receipt_body">
            <div class="receipt_title">电子小票</div>
            <div class="receipt_list">

                <div class="dotted">
                    <div class="weui-flex">
                        <div class="weui-flex__item"><div class="placeholder">日期：{{ $sale_info['saledate'] }}</div></div>
                        <div class="weui-flex__item"><div class="placeholder">机号：{{ $sale_info['syjid'] }}</div></div>
                    </div>

                    <div class="weui-flex">
                        <div class="weui-flex__item"><div class="placeholder">单号：{{ $sale_info['syjid'] }}</div></div>
                        <div class="weui-flex__item"><div class="placeholder">收银员：{{ $sale_info['invno'] }}</div></div>
                    </div>
                </div>

                <div class="weui-flex">
                    <div class="weui-flex__item"><div class="placeholder">货号</div></div>
                    <div class="weui-flex__item"><div class="placeholder">数量*单价</div></div>
                    <div class="weui-flex__item"><div class="placeholder">金额</div></div>
                </div>

                @foreach($sale_info['detail'] as $detail)
                    <div class="list">
                        <div class="weui-flex">
                            <div class="weui-flex__item"><div class="placeholder">{{ $detail['2']??'' }}</div></div>
                        </div>
                        <div class="weui-flex">
                            <div class="weui-flex__item"><div class="placeholder">{{ $detail['3']??'' }}</div></div>
                            <div class="weui-flex__item"><div class="placeholder">{{ $detail['6']??'' }}</div></div>
                            <div class="weui-flex__item"><div class="placeholder">{{ $detail['8']??'' }}</div></div>
                        </div>
                    </div>
                @endforeach

                <div class="dotted dotted-top">
                    <div class="weui-flex">
                        <div class="weui-flex__item"><div class="placeholder">购买件数：{{ count($goods_count) }}</div></div>
                        <div class="weui-flex__item"><div class="placeholder">应付金额：{{ $should_pay }}</div></div>

                    </div>
                    <div class="weui-flex">
                        <div class="weui-flex__item"><div class="placeholder">支付方式：{{ $sale_info['payment']['2']??'' }}</div></div>
                        <div class="weui-flex__item"><div class="placeholder">支付金额：{{ $sale_info['oughtpay'] }}</div></div>
                    </div>
                </div>
            </div>
        </div>

        <div class="weui-loadmore weui-loadmore_line">
            <span class="weui-loadmore__tips">到底了</span>
        </div>
    </div>
@endsection

@section('js')

    <script>

    </script>
@endsection